package com.xq.vo;

import lombok.Data;

import java.math.BigDecimal;
import java.util.Calendar;
import java.util.GregorianCalendar;


/**
 * 车类
 */
public class Cart {



    private int state=0;//状态（0内环，1外环）

    private BigDecimal kmNum=new BigDecimal(0);//公里数


    public int getCurrentHours(){
        GregorianCalendar calendar = new GregorianCalendar();
        int hour = calendar.get(Calendar.HOUR_OF_DAY);
        return hour;
    }

    /**
     * 获取是白天还是晚上，0白天，1晚上
     * @return
     */
    public int getDayOrNight(){
        int hour = getCurrentHours();
        if(hour>=23 || hour<=6){
            return 1;
        }else {
            return 0;
        }
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public BigDecimal getKmNum() {
        return kmNum;
    }

    public void setKmNum(BigDecimal kmNum) {
        this.kmNum = kmNum;
    }
}
